import { createRouter, createWebHistory } from 'vue-router'
import layout from '../views/layout/index.vue'
// import { defineAsyncComponent } from 'vue'
// import router from '@/router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: layout,
      redirect:'/dashboard',
      children:[{
        path: 'dashboard', 
        component:() => import('@/views/dashboard/index.vue'),
        meta: {
          title: '首页',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/ClueManage',
        name: 'ClueManage',
        component: () => import('../views/ClueManage/index.vue'),
        meta: {
          title: '线索管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/CommercialOpportunityManage',
        name: 'CommercialOpportunityManage',
        component: () => import('../views/CommercialOpportunityManage/index.vue'),
        meta: {
          title: '商机管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/ContractManage',
        name: 'ContractManage',
        component: () => import('../views/ContractManage/index.vue'),
        meta: {
          title: '合同管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/CourseManage',
        name: 'CourseManage',
        component: () => import('../views/CourseManage/index.vue'),
        meta: {
          title: '课程管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/ActivityManage',
        name: 'ActivityManage',
        component: () => import('../views/ActivityManage/index.vue'),
        meta: {
          title: '活动管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/TicketManage',
        name: 'TicketManage',
        component: () => import('../views/TicketManage/index.vue'),
        meta: {
          title: '工单管理',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/StatisticsManage',
        name: 'StatisticsManage',
        component: () => import('../views/StatisticsManage/index.vue'),
        meta: {
          title: '统计分析',
           icon: 'HomeOutlined'
        }
      },
      {
        path:'/SystemManage',
        name: 'SystemManage',
        redirect:'/SystemManage/secondLevel/NotificationCenter',
        meta: {
          title: '系统管理',
          icon: 'HomeOutlined'
        },
        children:[
          {
          path:'/SystemManage/secondLevel/NotificationCenter',
          name: 'NotificationCenter',
          component: () => import('../views/SystemManage/secondLevel/NotificationCenter/index.vue'),
          meta: {
            title: '通知中心',
             icon: 'HomeOutlined'
          },
        },
        {
          path:'/SystemManage/secondLevel/AuthorityManagement',
          name: 'AuthorityManagement',
          redirect:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/UserManagement',
          meta: {
            title: '权限管理 ',
             icon: 'HomeOutlined'
          },
          children:[
            {
              path:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/UserManagement',
              name: 'UserManagement',
              component: () => import('../views/SystemManage/secondLevel/AuthorityManagement/thirdLevel/UserManagement/index.vue'),
              meta: {
                title: '用户管理',
                  icon: 'HomeOutlined'
              },
            },
            {
              path:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/roleManagement',
              name: 'roleManagement',
              component: () => import('../views/SystemManage/secondLevel/AuthorityManagement/thirdLevel/roleManagement/index.vue'),
              meta: {
                title: '角色管理',
                  icon: 'HomeOutlined'
              },
            },
            {
              path:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/MenuManagement',
              name: 'MenuManagement',
              component: () => import('../views/SystemManage/secondLevel/AuthorityManagement/thirdLevel/MenuManagement/index.vue'),
              meta: {
                title: '菜单管理',
                  icon: 'HomeOutlined'
              },
            },
            {
              path:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/DepartmentManagement',
              name: 'DepartmentManagement',
              component: () => import('../views/SystemManage/secondLevel/AuthorityManagement/thirdLevel/DepartmentManagement/index.vue'),
              meta: {
                title: '部门管理',
                  icon: 'HomeOutlined'
              },
            },
            {
              path:'/SystemManage/secondLevel/AuthorityManagement/thirdLevel/JobManagement',
              name: 'JobManagement',
              component: () => import('../views/SystemManage/secondLevel/AuthorityManagement/thirdLevel/JobManagement/index.vue'),
              meta: {
                title: '岗位管理',
                  icon: 'HomeOutlined'
              },
            }
          ]
        },
        {
          path:'/SystemManage/secondLevel/DictionaryManagement',
          name: 'DictionaryManagement',
          component: () => import('../views/SystemManage/secondLevel/DictionaryManagement/index.vue'),
          meta: {
            title: '字典管理 ',
             icon: 'HomeOutlined'
          },
        },
        {
          path:'/SystemManage/secondLevel/ThreadAllocation',
          name: 'ThreadAllocation',
          component: () => import('../views/SystemManage/secondLevel/ThreadAllocation/index.vue'),
          meta: {
            title: '线索配置 ',
             icon: 'HomeOutlined'
          },
        },
        {
          path:'/SystemManage/secondLevel/BusinessOpportunityAllocation',
          name: 'BusinessOpportunityAllocation',
          component: () => import('../views/SystemManage/secondLevel/BusinessOpportunityAllocation/index.vue'),
          meta: {
            title: '商机配置',
             icon: 'HomeOutlined'
          },
        },
        {
          path:'/SystemManage/secondLevel/SystemLog',
          name: 'SystemLog',
          component: () => import('../views/SystemManage/secondLevel/SystemLog/index.vue'),
          meta: {
            title: '系统日志',
             icon: 'HomeOutlined'
          },
        },
        {
          path:'/SystemManage/secondLevel/logoutSystem',
          name: 'logoutSystem',
          component: () => import('../views/SystemManage/secondLevel/logoutSystem/index.vue'),
          meta: {
            title: '退出系统',
             icon: 'HomeOutlined'
          },
        }
      ]
      }
     ],
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/login/index.vue'),
      hidden:true
    },
    // LeadManagementRouter,

  ]
})

export default router
